<!--
 * @Author: jqm123 2289662078@qq.com
 * @Date: 2025-07-30 16:02:04
 * @LastEditors: jqm123 2289662078@qq.com
 * @LastEditTime: 2025-08-06 15:03:42
 * @FilePath: /anxinxiu/src/subpages/otherPages/audio.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div class="home">
    <div class="tabs">
      <div
        class="tab_content"
        :class="{ active: active == 0 }"
        @click="change(0)"
      >
        维修过程
      </div>
      <div class="line"></div>
      <div
        class="tab_content"
        :class="{ active: active == 1 }"
        @click="change(1)"
      >
        维修图片
      </div>
    </div>
    <div v-show="active == 0">
      <div id="video-container"></div>
      <div class="box">
        <div class="left">维修门店</div>
        <div class="right">{{ title }}</div>
      </div>
      <div class="tips">
        <p>
          1.直播具有时效性，订单完成后即结束直播。若需要查看完整视频可联系平台客服。
        </p>
        <p>
          2.
          因设备兼容性、网络信号或维护检修的等因素，直播过程可能出现卡顿、加载失败等情况，您可以拨打门店联系电话反馈
        </p>
      </div>
    </div>
    <div v-show="active == 1">
      <div class="pics">
        <div v-for="item in 4" :key="item" class="pic">
          <van-image width="100%" src="https://img01.yzcdn.cn/vant/cat.jpeg" />
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { EZUIKitPlayer } from "ezuikit-js";
const width = document.documentElement.clientWidth;
const height = (document.documentElement.clientWidth * 9) / 16;
export default {
  components: {},
  data() {
    return {
      player: null,
      title: "",
      active: 0,
    };
  },
  computed: {},
  watch: {},
  created() {},
  beforeDestroy() {
    this.player && this.player.destroy();
  },
  mounted() {
    let token = this.$route.query.accessToken;
    let url = this.$route.query.url;
    this.title = this.$route.query.storeName;
    this.initAudio(token, url);
  },
  methods: {
    initAudio(accessToken, url) {
      this.player = new EZUIKitPlayer({
        id: "video-container",
        url,
        accessToken,
        width,
        height,
        template: "simple",
      });
    },
    change(num) {
      this.active = num;
    },
  },
};
</script>

<style scoped lang="less">
.home {
  min-height: 100vh;
  background-image: url("https://zxcxappimg.cxbtv.cn/qinghai/2025/08/06/26cf2efa8b7557d0ac94ca66d23f1bc5.png");
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  .tabs {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    .line {
      height: 40px;
      width: 2px;
      background: #999;
    }
    .tab_content {
      font-size: 50px;
      padding: 30px 20px;
      color: #727272;
    }
    .active {
      color: #303030;
    }
  }
  .box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 60px 0 15px 0;
    margin: 0 30px;
    border-bottom: 0.5px solid #416dfc;
    .left {
      font-size: 50px;
      color: #000;
      font-weight: bold;
    }
    .right {
      font-size: 48px;
      color: #2d2d2d;
    }
  }
  .tips {
    margin: 100px 30px 0 30px;
    background-color: #fff;
    padding: 10px;
    font-size: 30px;
    color: #616161;
  }
  .pics {
    width: 100%;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    .pic {
      width: 48%;
      aspect-ratio: 4 / 3;
    }
  }
}
</style>
